<template>
  <div>
    <h1>查询账目信息</h1>
    <!-- <el-input size="medium" v-model="search_cno" placeholder="请输入课程编号"></el-input>
    <el-button @click="search()" icon="el-icon-search" circle></el-button> -->
    <el-form>
      <el-button @click="count" type="primary">点击查询账目数量</el-button>
    </el-form>
    <el-table
      :data="tableData"
      border
      style="width:100%">
      <el-table-column
        fixed
        prop="sno"
        label="学生编号"
        width="150">
      </el-table-column>
      <el-table-column
        prop="cno"
        label="课程编号"
        width="120">
      </el-table-column>
      <el-table-column
        prop="adate"
        label="缴费日期"
        width="120">
      </el-table-column>
      <el-table-column
        prop="aclass"
        label="班级编号"
        width="120">
      </el-table-column>
      <el-table-column
        prop="aamount"
        label="缴费金额"
        width="120">
      </el-table-column>

    </el-table>
  </div>
</template>

<script>
export default {
  name: "FindAmount",
  data() {
    return {
      stuNo:'',
      tableData:null,
      counts:'',
      user:{
        sno:'',
        cno:'',
        adate:'',
        aclass:'',
        aamount:'',
      },
      sno:'',
      cno:'',
      adate:'',
      aclass:'',
      aamount:'',
    }
  },
  created(){
    const  _this = this;
    const params = {
      sno: this.sno,
      cno:this.cno,
      adate:this.adate,
      aclass:this.aclass,
      aamount: this.aamount,
    }
    this.$axios.post(`http://localhost:8081/FindAmount`, params).then((res) => {
      console.log(res.data);
      _this.tableData = res.data;

    })
  },
  methods:{
    count(){
      this.$axios.post(`http://localhost:8081/CountAmount`).then((res) => {
        console.log(res.data);
        this.counts = res.data;
        console.log("账目数量：", this.counts);
        if (res.data.msg=="返回账目数量成功") {
          alert("账目数量：" + res.data.data)
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
